From 0a045970ea87458dad6fe7cebcb286f648ebec5c Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 24 Sep 2005 08:58:41 +0100 Subject: [PATCH] Fix tpm split driver to follow changes in the xenbus API. Signed-off-by: Stefan Berger --- linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c | 12 ++++++++++-- linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c index 49c946aeec..3bb1247a00 100644 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c @@ -93,7 +93,8 @@ static void frontend_changed(struct xenbus_watch *watch, const char *node) * Tell the front-end that we are ready to go - * unless something bad happens */ - err = xenbus_transaction_start(be->dev->nodename); +again: + err = xenbus_transaction_start(); if (err) { xenbus_dev_error(be->dev, err, "starting transaction"); return; @@ -127,7 +128,14 @@ static void frontend_changed(struct xenbus_watch *watch, const char *node) goto abort; } - xenbus_transaction_end(0); + err = xenbus_transaction_end(0); + if (err == EAGAIN) + goto again; + if (err) { + xenbus_dev_error(be->dev, err, "end of transaction"); + goto abort; + } + xenbus_dev_ok(be->dev); return; abort: diff --git a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c index f19676d1db..a9535a08f4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c @@ -331,7 +331,8 @@ static int talk_to_backend(struct xenbus_device *dev, goto out; } - err = xenbus_transaction_start(dev->nodename); +again: + err = xenbus_transaction_start(); if (err) { xenbus_dev_error(dev, err, "starting transaction"); goto destroy_tpmring; @@ -363,6 +364,8 @@ static int talk_to_backend(struct xenbus_device *dev, } err = xenbus_transaction_end(0); + if (err == EAGAIN) + goto again; if (err) { xenbus_dev_error(dev, err, "completing transaction"); goto destroy_tpmring; -- 2.30.2